package com.example.backend.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 后端网关服务
 * nacos的dataId是 backendGateway.properties
 * @author vanson
 */
@EnableCaching
@EnableDiscoveryClient
@SpringBootApplication
public class BackendGatewayServiceApplication {
    public static void main(String[] args) {
        // 无法从nacos动态更新配置解决办法：
        // 方式一：在nacos里设置 spring.cloud.nacos.config.name 属性，值为${spring.application.name}
        // 方式二：设置环境变量，用于NacosPropertySourceLocator里获取dataIdPrefix;
        // System.setProperty("spring.application.name", "backendGateway");
        SpringApplication.run(BackendGatewayServiceApplication.class, args);
    }
}
